package com.it.schoolbookshop_back.enums;

/**
 * 书本品相枚举
 */
public enum BookConditionEnum {
    NEW("几乎全新"),
    GOOD("品相良好"),
    USED("有使用痕迹");

    private final String label;

    BookConditionEnum(String label) {
        this.label = label;
    }

    public String getLabel() {
        return label;
    }

    public static BookConditionEnum fromLabel(String label) {
        for (BookConditionEnum e : values()) {
            if (e.label.equals(label)) {
                return e;
            }
        }
        return null;
    }
} 